﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="INGRESOMANTENIMIENTO.aspx.vb" Inherits="IMSS.SA.Formulario_web13" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .style4
    {
        text-align: center;
    }
    .style6
    {
        text-align: center;
    }
    .style7
    {
        text-align: center;
        width: 137px;
    }
        .style8
        {
            text-align: center;
            width: 137px;
            height: 11px;
        }
        .style9
        {
            text-align: center;
            height: 11px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width:100%; color: #FFFFFF; background-color: #006699; background-image: url('../Styles/r3.PNG'); background-repeat: no-repeat;">
        <tr>
            <td class="style4" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" colspan="2">
                <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style4" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" colspan="2">
                INGRESO DE DATOS DE MANTENIMIENTO</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                ID_MANTENIMIENTO</td>
            <td class="style4">
                <asp:TextBox ID="TexMANTENIMIENTO" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style8">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                ID_SERVICIO</td>
            <td class="style9">
                <asp:TextBox ID="TexSERVICIO" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                FECHA</td>
            <td class="style4">
                <asp:TextBox ID="TexFECHA" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                <asp:Button ID="ENVIAR" runat="server" Text="ENVIAR" />
            </td>
            <td class="style4">
                <asp:Button ID="BORRAR" runat="server" Text="BORRAR" />
            </td>
        </tr>
        <tr>
            <td class="style6" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" colspan="2">
                <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" 
                    AutoGenerateColumns="False" DataKeyNames="Id_mantenimiento" Width="907px">
                    <Columns>
                        <asp:BoundField DataField="Id_mantenimiento" HeaderText="Id_mantenimiento" 
                            ReadOnly="True" SortExpression="Id_mantenimiento" />
                        <asp:BoundField DataField="Id_servicio" HeaderText="Id_servicio" 
                            SortExpression="Id_servicio" />
                        <asp:BoundField DataField="Fecha" HeaderText="Fecha" SortExpression="Fecha" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:IMSS.SAConnectionString7 %>" 
                    DeleteCommand="DELETE FROM [MANTENIMIENTO] WHERE [Id_mantenimiento] = @Id_mantenimiento" 
                    InsertCommand="INSERT INTO [MANTENIMIENTO] ([Id_mantenimiento], [Id_servicio], [Fecha]) VALUES (@Id_mantenimiento,@Id_servicio,@Fecha)" 
                    SelectCommand="SELECT * FROM [MANTENIMIENTO]" 
                    UpdateCommand="UPDATE [MANTENIMIENTO] SET [Id_servicio] = @Id_servicio, [Fecha] = @Fecha WHERE [Id_mantenimiento] = @Id_mantenimiento">
                    <DeleteParameters>
                        <asp:Parameter Name="Id_mantenimiento" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="TexMANTENIMIENTO" Name="Id_mantenimiento" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexSERVICIO" Name="Id_servicio" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexFECHA" DbType="Date" Name="Fecha" 
                            PropertyName="Text" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Id_servicio" Type="String" />
                        <asp:Parameter DbType="Date" Name="Fecha" />
                        <asp:Parameter Name="Id_mantenimiento" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
